<template>
  <div class="tabbar-item">
      <van-nav-bar :fixed="true"
        :title="title"
      />
      <div id="main">
       <router-view @toparent="getval"></router-view>
      </div>
      <van-tabbar route v-model="active"
      active-color='#ffd01e'
      >
        <van-tabbar-item icon="send-gift-o" to="/home">首页</van-tabbar-item>
        <van-tabbar-item icon="gift-o"  to="/search">私享体验</van-tabbar-item>
        <van-tabbar-item icon="shopping-cart-o" to="/cart">购物车</van-tabbar-item>
				<van-tabbar-item icon="contact" to="/setting">我的</van-tabbar-item>
      </van-tabbar>
  </div>
</template>

<script>
  export default{
    name:'Shouye',
    data(){
      return{
        active:0,
        title:"首页",
        isLoading:false,
        currentRouter:'/'
      }
    },
    methods:{
      getval(msg){
        this.title = msg
      },
      onRefresh() {
            setTimeout(() => {
              this.$toast('刷新成功');
              this.isLoading = false;
              this.count++;
            }, 500);
          }
    },
     watch:{
        '$route':function(to,from){
            this.currentRouter=to.path;
        },
        beforeMount(){
            this.currentRouter=this.$route.path;
        },
      },



  }
</script>

<style scoped="">
  #main{
    margin-bottom: 50px;
  }
  .tabbar-item >>>.van-tabbar-item__icon{
    font-size: 0.6rem;
  }
  .van-tabbar--fixed{
    border-top: 1px solid #DDDDDD;
  }
</style>
